/**
 * 商品模块的接口文档
 */
import request from "./request";
/**
 * @param  {Object} model
 * 
 */
export const getGoodsList = (model) => request.get('goods', { params: model })
    /** 
     * 获取分类商品
     */
export const getParamsList = () => request.get('categories')

/** 
 * 获取商品分类
 * @param {Number} id
 * @param{String} type
 */
export const getAttributes = (id, type) => request.get(`categories/${id}/attributes?sel=${type}`)



/**.
 * @method
 * @description 添加属性
 * @param {Numbwe} id 分类ID
 * @param {Object}   model  要添加的属性模型
 * 获取参数列表
 */
export const addAttributes = (id, model) => request.post(`categories/${id}/attributes`, model)
    /**.
     * @method
     * @description 修改属性
     * @param {Numbwe} id 分类ID
     * @param {Object}   model  要修改的属性模型
     * 获取参数列表
     */
export const updateAttributes = (id, model) => request.put(`categories/${id}/attributes/${model.attr_id}`, model)